<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"   
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:ui="http://java.sun.com/jsf/facelets"  
     xmlns:p="http://primefaces.org/ui"
     template="../generales/plantillas/plantillaMain.xhtml">
     
	<ui:define name="content">
		<h:form prependId="false">
			<p:panel id="lista_usuarios" header="#{msg['list.usuarios.titulo']}">
							
				<p:dataTable var="car" value="#{usuarioBean}" paginator="true" rows="10"
                 paginatorTemplate="{RowsPerPageDropdown} {FirstPageLink} {PreviousPageLink} {CurrentPageReport} {NextPageLink} {LastPageLink}"
                 rowsPerPageTemplate="5,10,15" selectionMode="single" selection="#{tableBean.selectedCar}">

			        <p:ajax event="rowSelect" listener="#{tableBean.onRowSelect}" update=":form:display" oncomplete="carDialog.show()" />
			
			        <p:column headerText="Model" sortBy="#{car.model}" filterBy="#{car.model}">
			            <h:outputText value="#{car.model}" />
			        </p:column>
			
			        <p:column headerText="Year" sortBy="#{car.year}" filterBy="#{car.year}">
			            <h:outputText value="#{car.year}" />
			        </p:column>
			
			        <p:column headerText="Manufacturer" sortBy="#{car.manufacturer}" filterBy="#{car.manufacturer}">
			            <h:outputText value="#{car.manufacturer}" />
			        </p:column>
			
			        <p:column headerText="Color" sortBy="#{car.color}" filterBy="#{car.color}">
			            <h:outputText value="#{car.color}" />
			        </p:column>
			    </p:dataTable>			
			</p:panel>			
		</h:form>
	</ui:define>
</ui:composition>